home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / Gfx4PCQ.lha / WindowLib / Examples / FillDemo / FillDemo.p < prev    next >
Encoding:
Text File  |  1997-07-19  |  1.3 KB  |  46 lines

  1. Program FillDemo;
  2.  
  3. { A sample program for PCQ, using fill patterns. © 1997 THOR-Software inc.}
  4.  
  5. {$I "Include:Utils/Windowlib.i"}
  6.  
  7. CONST
  8.     fillarray    :    Array[0..1] of Short=
  9.         ($aaaa,$5555);
  10.     {A monochrome fill pattern, a checkered style }
  11.  
  12.     multiarray    :    Array[0..3] of Short=
  13.         ($aaaa,$5555,$5555,$aaaa);
  14.     {A colored fill pattern for a depth 2 screen, again checkered }
  15. VAR
  16.     w    :    WindowPtr;
  17.     s    :    ScreenPtr;
  18.  
  19. BEGIN
  20.     InitGraphics;
  21.  
  22.     s:=OpenAScreen(0,0,640,200,2,MON_HIRES,"FillDemo");
  23.     IF s<>NIL THEN BEGIN
  24.         w:=OpenScreenWindow(s,0,0,600,200,WINFLG_DRAGBAR+WINFLG_DEPTHGADGET+WINFLG_CLOSEGADGET,"FillTest");
  25.         IF w<>NIL THEN BEGIN
  26.             Color(w,1);        {select color}
  27.             Boundary(w,TRUE);
  28.             OlColor(w,2);        {enable boundary and set boundary color}
  29.             SetFillPattern(w,@fillarray[0],1,1); {choose fill style. 
  30.             Parameters are: Address of the first word in the array, the height as power of two
  31.             and the depth. Only one or the screen depth (2 here) are allowed.} 
  32.             PEllipse(w,300,100,160,80);    {draw filled ellipse}
  33.             SetFillPattern(w,NIL,0,0);    {disable the pattern}
  34.             Color(w,3);            {different color}
  35.             PEllipse(w,100,100,50,25);    {again filled ellipse}
  36.             SetFillPattern(w,@multiarray[0],1,2);    {this time a pattern of depth 2}
  37.             PEllipse(w,500,100,50,25);    {another ellipse}    
  38.             WaitForClose(w);        {we're done}
  39.             CloseAWindow(w)
  40.         END;
  41.         CloseAScreen(s)
  42.     END;
  43.  
  44.     ExitGraphics;
  45. END.
  46.